﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BaHuan.Common;
using BaHuan.Entities;
using BaHuan.DataLayer;

namespace BaHuan.BusinessLayer
{
    public class LoaiPhieuMgt
    {
        public ResultObj SaveNewLoaiPhieu(LoaiPhieu loaiphieu)
        {
            ResultObj result = new ResultObj();
            loaiphieu.Id = -1;
            LoaiPhieuDAO loaiphieuDAO = new LoaiPhieuDAO();
            result = loaiphieuDAO.SaveLoaiPhieu(loaiphieu);

            return result;
        }

        public ResultObj UpdateLoaiPhieu(LoaiPhieu loaiphieu)
        {
            ResultObj result = new ResultObj();
            LoaiPhieuDAO loaiphieuDAO = new LoaiPhieuDAO();
            result = loaiphieuDAO.SaveLoaiPhieu(loaiphieu);

            return result;
        }

        public ResultObj DeleteLoaiPhieu(LoaiPhieu loaiphieu)
        {
            ResultObj result = new ResultObj();
            LoaiPhieuDAO loaiphieuDAO = new LoaiPhieuDAO();
            result = loaiphieuDAO.DeleteLoaiPhieu(loaiphieu);

            return result;
        }

        public ResultObj GetAllLoaiPhieu()
        {
            ResultObj result = new ResultObj();
            LoaiPhieuDAO loaiphieuDAO = new LoaiPhieuDAO();
            result = loaiphieuDAO.GetAllLoaiPhieu();

            return result;
        }

        public ResultObj GetLoaiPhieuById(LoaiPhieu loaiphieu)
        {
            ResultObj result = new ResultObj();
            LoaiPhieuDAO loaiphieuDAO = new LoaiPhieuDAO();
            result = loaiphieuDAO.GetAllLoaiPhieuByID(loaiphieu);

            return result;
        }
    }
}
